<!--提交测试 添加申请记录弹出框-->
<script type="text/ng-template" id="editionToTestTemplate.html">
    <style>
        .modal-content {
            width: 1350px;
            right: 380px;
        }
    </style>
    <div class="modal-header">
        <h4 ng-if="info.type=='TEST'">版本提交测试</h4>
        <h4 ng-if="info.type=='INTEGRATION'">版本提交转测</h4>
    </div>
    <div class="modal-body">
        <uib-accordion close-others="false">
            <uib-accordion-group heading="工程信息" is-open="true">
                <div ng-if="info.type=='INTEGRATION'" style="color: red;">
                    提交转测版本说明:
                    <br>
                    1、提交转测版本，以中午12点为界，每天上午和下午都可以提交一个版本。当上午或者下午已经提交过一次版本后，
                    <br>
                    除非是解决阻塞性bug，不允许提交版本。多余的提交版本，默认认为都是解决阻塞性bug版本。
                    <br>
                    例：上午已经提交了一个转测版本，如果有新版本要提交，新版本是解决阻塞bug时，可以提交，提交时有弹窗确认。
                    <br>
                    如果不是解决阻塞bug，则要等到下午再提交版本。
                </div>
                <br>
                <table class="table table-hover table-bordered text-center">
                    <tr>
                        <td>工程名:</td>
                        <td>{{info.projectName}}</td>
                    </tr>
                    <tr>
                        <td>
                            <span ng-if="info.type=='TEST'">当前提测版本:</span>
                            <span ng-if="info.type=='INTEGRATION'">当前转测版本:</span>
                        </td>
                        <td>
                            <span ng-if="info.type=='TEST'">{{info.projectInfo.to_test_edition}}</span>
                            <span ng-if="info.type=='INTEGRATION'">{{info.projectInfo.to_integration_edition}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td>新提交版本:</td>
                        <td>
                            <span ng-if="info.type=='TEST' && info.projectInfo.package_type != 'ad'">
                                {{info.selectEdition.showNum}}
                            </span>
                            <span ng-if="info.type=='INTEGRATION' || (info.type=='TEST' && info.projectInfo.package_type == 'ad')">
                                <input type="text" ng-model="info.selectEdition" placeholder="Select Edition Here..."
                                       uib-typeahead="edition as edition.showNum for edition in info.editionList | filter:{showNum:$viewValue}|limitTo:15"
                                       typeahead-template-url="selectTemplate.html" class="form-control"
                                       typeahead-show-hint="true" typeahead-min-length="0" ng-disabled="!info.status"
                                       typeahead-select-on-blur="true" typeahead-on-select="editionChange();">
                            </span>
                        </td>
                    </tr>
                    <tr ng-if="info.type=='TEST'">
                        <td></td>
                        <td style="color: red;">只有构建成功的临时版本才能提交测试.提交时,会自动生成版本号!</td>
                    </tr>
                </table>
            </uib-accordion-group>
            <uib-accordion-group ng-if="info.status && info.selectEdition.editionNum != undefined" heading="附加说明"
                                 is-open="true">
                <uib-accordion close-others="false">
                    <uib-accordion-group heading="提交说明(必填,请说明这次提交的修改点,测试点以及注意事项)" is-open="true">
                        <div>
                            <textarea wrap="off" style="overflow-y:scroll;width: 100%;"
                                      ng-model="info.otherDesc" rows="2"></textarea>
                        </div>
                    </uib-accordion-group>
                    <uib-accordion-group heading="SQL变动" is-open="true">
                        <div>
                            <h5>
                                <span style="color: #00acd6;">请选择这个版本需要测试人员执行的sql脚本</span>
                                <i class="glyphicon glyphicon-refresh i_class"
                                   style="margin-left: 10%;"
                                   data-ng-click="getSqlList();"
                                   uib-popover="刷新sql文件列表"
                                   popover-trigger="mouseenter"></i>
                            </h5>
                            <div style="max-height: 200px;overflow-y: auto;">
                                <span ng-if="info.sqlList.length == 0" style="color: red;">没有sql脚本</span>
                                <table class="table table-hover table-bordered text-center"
                                       ng-if="info.sqlList.length > 0">
                                    <thead>
                                    <tr>
                                        <th>
                                            <input ng-model="info.checkAllSql" ng-true-value="true"
                                                   ng-false-value="false" type="checkbox" ng-click="checkAll('sql');">全选
                                        </th>
                                        <th>
                                            sql脚本
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="sql in info.sqlList track by $index">
                                        <td>
                                            <input ng-model="sql.isCheck" ng-true-value="true"
                                                   ng-false-value="false" type="checkbox">
                                        </td>
                                        <td>
                                            <a href="javascript:void(0)" ng-click="downloadSqlFile(sql);">{{sql.file_name}}(点击下载)</a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </uib-accordion-group>
                    <uib-accordion-group heading="配置变动" is-open="true">
                        <div>
                            <h5>
                                <span style="color: #00acd6;">请选择这个版本需要测试人员修改的配置项</span>
                                <i class="glyphicon glyphicon-refresh i_class"
                                   style="margin-left: 10%;"
                                   data-ng-click="getConfigList();"
                                   uib-popover="刷新配置列表"
                                   popover-trigger="mouseenter"></i>
                            </h5>
                            <div style="max-height: 200px;overflow-y: auto;">
                                <span ng-if="info.configList.length == 0" style="color: red;">没有配置项</span>
                                <table class="table table-hover table-bordered text-center"
                                       ng-if="info.configList.length > 0">
                                    <thead>
                                    <tr>
                                        <th>
                                            <input ng-model="info.checkAllConfig" ng-true-value="true"
                                                   ng-false-value="false" type="checkbox"
                                                   ng-click="checkAll('config');">全选
                                        </th>
                                        <th>
                                            配置文件
                                        </th>
                                        <th>
                                            配置项
                                        </th>
                                        <th>
                                            配置说明
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="config in info.configList track by $index">
                                        <td>
                                            <input ng-model="config.isCheck" ng-true-value="true"
                                                   ng-false-value="false" type="checkbox"/>
                                        </td>
                                        <td>
                                            {{config.fileName}}
                                        </td>
                                        <td>
                                            {{config.key}}={{config.value}}
                                        </td>
                                        <td>
                                            <input ng-model="config.desc" type="text"/>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </uib-accordion-group>
                </uib-accordion>
            </uib-accordion-group>
        </uib-accordion>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="button"
                ng-disabled="!info.status || info.selectEdition.editionNum == undefined" ng-click="save();">保存
        </button>
        <button class="btn btn-primary" type="button" ng-click="cancel();">关闭</button>
    </div>
</script>